package com.ego.item.mapper;

import com.ego.item.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface CategoryMapper extends Mapper<Category>,SelectByIdListMapper<Category,Long> {
    @Update("update tb_category set name=#{name} where id=#{id}")
    void updateNameById(@Param("id") Long id,@Param("name") String name);
    @Select("select * from tb_category where id in(select category_id from tb_category_brand where brand_id=#{bid})")
    List<Category> findListByBid(@Param("bid") Long bid);
}
